{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import holoviews as hv\n",
    "from holoviews.streams import Pipe, Buffer\n",
    "import pandas as pd\n",
    "class real_time_plot:\n",
    "    def __init__(self, plot_len):\n",
    "        hv.extension('bokeh')\n",
    "        st = pd.DataFrame({'y':[]}, columns=['y'])\n",
    "        self.dfstream = Buffer(st, length=plot_len, index=False)\n",
    "        curve_dmap = hv.DynamicMap(hv.Curve, streams=[self.dfstream])\n",
    "        curve_dmap.opts(width=800, height=600)\n",
    "        display(curve_dmap)\n",
    "    def send(self, data):\n",
    "        self.dfstream.send(pd.DataFrame({'y':trace.wave}))"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
